#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;

int count = 0;

void mov(int n, char begin, char end)
{
	char temp = 'X';
	if (n == 1)
		count++;
	else
	{
		mov(n - 1, begin, temp);
		mov(1, begin, end);
		mov(n - 1, temp, end);
	}
}

void move(int n, char A, char B, char C)
{
	mov(n, A, C);
}

void Hanoi(int n,string A,string B,string C)
{
	if (n == 1)
	{
		cout << "Move top disk from peg " << A << " to peg " << C << endl;
		count++;
	}
	else
	{
		Hanoi(n - 1, A, C, B);
		count++;
		cout << "Move top disk from peg " << A << " to peg " << C << endl;
		Hanoi(n - 1, B, A, C);
	}
}

int main(void)
{
	//string A("A");
	//string B("B");
	//string C("C");
	//Hanoi(10, A, B, C);
	mov(10,'A','B');
	cout << "count = " << count << endl;
}